package com.ruoyi.system.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.Subject;
import com.ruoyi.system.domain.dto.SubjectDto;
import com.ruoyi.system.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 智题分科目
 */
@RestController
@RequestMapping("app/api/subject")
//@Api(tags = "app科目模块")
public class SubjectController extends BaseController {
    @Autowired
    private SubjectService subjectService;

    /**
     * 查询科目列表
     * @param subjectDto
     * @return
     */
//    @ApiOperation(value = "科目列表查询",response = Subject.class)
    @GetMapping("/list")
    public TableDataInfo list( @RequestBody SubjectDto subjectDto)
    {
        startPage();
        List<Subject> list = subjectService.selectSubjectList(subjectDto);
        return getDataTable(list);
    }

//    @ApiOperation(value = "科目列表查询",response = Subject.class)
//    @GetMapping("/list")
//    public R<List<Subject>> list(@RequestBody  Subject subject)
//    {
//        startPage();
//        List<Subject> list = subjectService.selectSubjectList(subject);
//        return R.ok(list);
//    }
}
